<?php
// +----------------------------------------------------------------------
// | author: admin
// +----------------------------------------------------------------------

namespace app\common\model\travel;


use app\common\model\BaseModel;
use app\common\model\dict\DictData;
use app\common\model\user\User;


/**
 * LinePrice模型
 * Class LinePrice
 * @package app\common\model\travel
 */
class LinePrice extends BaseModel
{
    
    protected $name = 'line_price';

    /**
     * @notes 获取器-线路名
     * @param $value
     * @param $data
     * @return string|string[]
     */
    public function getLineNameAttr($value, $data)
    {
        return Line::where('id', $data['line_id'])->value('title');
    }

    public function getStatusValueAttr($value, $data)
    {
        return DictData::where('type_value', 'approval_status')->where('value',$data['status'])->value('name');
    }

    public function getStatusRemarkAttr($value, $data)
    {
        return DictData::where('type_value', 'approval_status')->where('value',$data['status'])->value('remark');
    }

    public function getUserAccountAttr($value, $data)
    {
        return User::where('id', $data['user_id'])->value('account');
    }

    
}